home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / source / xcode / vga.inc < prev    next >
Encoding:
Text File  |  1993-10-01  |  2.9 KB  |  115 lines

  1. ;----------------------------------------------------------------------------:
  2. ; SILVERMOON                                                                 :
  3. ;                                                                             :
  4. ; INCLUDE File for VGA constants and useful macros                             :
  5. ;----------------------------------------------------------------------------:
  6.  
  7.  
  8. ;----------------------------------------------------------------------------:
  9. ; Colour VGA register equates                                                 :
  10. ;----------------------------------------------------------------------------:
  11.  
  12.  
  13. ; I/O ports for accessing VGA
  14.  
  15. Miscellaneous_Output_Write_Port EQU 03c2h
  16. Miscellaneous_Output_Read_Port    EQU 03cch
  17. Input_Status_0_Port             EQU 03c2h
  18. Input_Status_1_Port             EQU 03dah
  19. Sequencer_Address_Port            EQU 03c4h
  20. Sequencer_Data_Port             EQU 03c5h
  21. CRTC_Address_Port                EQU 03d4h
  22. CRTC_Data_Port                    EQU 03d5h
  23. Graphics_Address_Port            EQU 03ceh
  24. Graphics_Data_Port                EQU 03cfh
  25. Attribute_Address_Write_Port    EQU 03c0h
  26. Attribute_Address_Read_Port     EQU 03c1h   
  27. PEL_Address_Write_Mode_Port     EQU 03c8h
  28. PEL_Address_Read_Mode_Port        EQU 03c7h
  29. PEL_Data_Port                    EQU 03c9h
  30. DAC_State_Port                    EQU 03c7h
  31. PEL_Mask_Port                    EQU 03c6h
  32.  
  33.  
  34. ; Addresses of sequencer registers
  35.  
  36. Reset                    EQU 0
  37. Clocking_Mode            EQU 1
  38. Map_Mask                EQU 2
  39. Character_Map_Select    EQU 3
  40. Memory_Mode             EQU 4
  41.  
  42. ; Addresses of CRTC registers
  43.  
  44. Horizontal_Total            EQU 0
  45. Horizontal_Display_End        EQU 1
  46. Start_Horizontal_Blanking    EQU 2
  47. End_Horizontal_Blanking     EQU 3
  48. Start_Horizontal_Retrace    EQU 4
  49. End_Horizontal_Retrace        EQU 5
  50. Vertical_Total                EQU 6
  51. Overflow                    EQU 7
  52. Preset_Row_Scan             EQU 8
  53. Max_Scan_Line                EQU 9
  54. Cursor_Start                EQU 10
  55. Cursor_End                    EQU 11
  56. Start_Address_High            EQU 12
  57. Start_Address_Low            EQU 13
  58. Cursor_Location_High        EQU 14
  59. Cursor_Location_Low         EQU 15
  60. Vertical_Retrace_Start        EQU 16
  61. Vertical_Retrace_End        EQU 17
  62. Vertical_Display_End        EQU 18
  63. ;Offset                     EQU 19
  64. Underline_Location            EQU 20
  65. Start_Vertical_Blanking     EQU 21
  66. End_Vertical_Blanking        EQU 22
  67. Mode_Control                EQU 23
  68. Line_Compare                EQU 24
  69.  
  70. ; Addresses of Graphics registers
  71.  
  72. Set_Reset                EQU 0
  73. Enable_Set_Reset        EQU 1
  74. Colour_Compare            EQU 2
  75. Data_Rotate             EQU 3
  76. Read_Map_Select         EQU 4
  77. Mode                    EQU 5
  78. Miscellaneous            EQU 6
  79. Colour_Dont_Care        EQU 7
  80. Bit_Mask                EQU 8
  81.  
  82. ; Addresses of Attribute registers
  83.  
  84. Palette                     EQU 0
  85. Attribute_Mode_Control        EQU 010h
  86. Overscan_Colour             EQU 011h
  87. Colour_Plane_Enable         EQU 012h
  88. Horizontal_Pixel_Panning    EQU 013h
  89. Colour_Select                EQU 014h
  90.  
  91. MACRO    Wait_for_Vertical_Retrace
  92.         LOCAL    VR_Wait
  93.         PUSH    AX
  94.         PUSH    DX
  95. VR_Wait:
  96.         MOV     DX,Input_Status_1_Port            ; hang around for vblank tick
  97.         IN        AL,DX
  98.         TEST    AL,8
  99.         JZ        SHORT VR_Wait
  100.         POP     DX
  101.         POP     AX
  102. ENDM
  103.  
  104. ;----------------------------------------------------------------------------:
  105. ; Screen Resolution                                                          :
  106. ;----------------------------------------------------------------------------:
  107.  
  108.  
  109. VGA_X_Resolution EQU 320
  110. VGA_Y_Resolution EQU 200
  111.  
  112.  
  113.  
  114.  
  115.